<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增数据源')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-source-add">
            <div class="form-group">    
                <label class="col-sm-3 control-label">数据源标题：</label>
                <div class="col-sm-8">
                    <input name="title" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">驱动：</label>
                <div class="col-sm-8">
<select name="drive" id="drive" class="form-control">
<option value="">--请选择--</option>
<option th:each="item:${dataSourceDrives}" th:value="${item.value}" th:text="${item.value}"></option>
</select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">数据源连接：</label>
                <div class="col-sm-8">
                    <input name="conn" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">如</label>
                <div class="col-sm-8">
<p align="left">jdbc:mysql://localhost:3306/databand?useUnicode=true&characterEncoding=utf8&useSSL=true</p>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">用户名：</label>
                <div class="col-sm-8">
                    <input name="username" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">密码：</label>
                <div class="col-sm-8">
                    <input name="password" class="form-control" type="password">
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var prefix = ctx + "web/source"
        $("#form-source-add").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/add", $('#form-source-add').serialize());
            }
        }
    </script>
</body>
</html>